package ioc

import (
	"bbs-web/pkg/logger"
	"go.uber.org/zap"
)

func InitLogger() logger.Logger {
	zapLogger, err := zap.NewProduction()
	if err != nil {
		panic(err)
	}
	defer zapLogger.Sync() //确保在程序退出之前，把buffer缓存区的日志记录到磁盘或者控制台
	return logger.NewZapLogger(zapLogger)
}
